feat: add coordinator/delegate expert separation#588
Merged
Conversation
Introduce a formal distinction between coordinator and delegate experts based on naming convention (@scope/name for delegates). Enforce delegation rules via Zod schema validation and provide type-specific meta-prompts. - Add expert-type utilities for classification and delegation validation - Split meta-prompt: coordinators get parallelism/task-splitting guidance - Validate delegation rules in expertSchema via superRefine - Rename E2E and root config delegates to @coordinator/name convention - Remove old examples directory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…riter delegates Replace the monolithic expert with a coordinator that orchestrates two focused delegates: @expert/planner (designs architectures) and @expert/definition-writer (writes and tests perstack.toml definitions). Each delegate embeds deep Perstack best practices in its instruction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The coordinator expert key was "expert" instead of "create-expert", inconsistent with the app name. Rename all expert keys and delegate references accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ester - Coordinator now only routes file paths between delegates, no domain logic - Planner writes design to perstack/plan.md instead of returning as text - Definition-writer reads plan file and writes perstack.toml (no testing) - New @create-expert/expert-tester delegate handles all testing concerns - Coordinator orchestrates: planner -> definition-writer -> expert-tester Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a new skill management tool that loads experts from a perstack.toml config file and adds them as delegates in a single step. Update create-expert definitions to use this tool, simplify plan file paths, and add workspace investigation guidance for delegates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Error nodes are terminal just like completed nodes, but flattenTree() was only filtering out completed children. This caused stale failed attempts to clutter the tree when a parent retried delegation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make stepNumber always start at 1 for each run, completing the decoupling from the removed maxSteps feature. Accumulate totalSteps across runs in the job instead. - Rename createNextStepCheckpoint to createRunStartCheckpoint (stepNumber: 1) - Reset stepNumber to 1 in delegation child/return checkpoints - Accumulate job.totalSteps across runs (job.totalSteps + resultCheckpoint.stepNumber) - Refresh job from storage after delegation to pick up child updates - Replace stepNumber-based checkpoint sorting with file mtime - Remove maxStepNumber parameter from TUI event fetching - Fix log data-fetcher fallback to sum max stepNumber per runId - Remove deleted --max-steps E2E test - Fix create-expert E2E: update expertKey and tool name assertions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
762ea36 to
ff355e8
Compare
This was referenced Feb 20, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@scope/namefor delegates)superRefineonexpertSchemaperstack.tomlto follow@coordinator/nameconventionexamples/directoryKey changes
packages/coreexpert-type.tsutilities + delegation validation inexpertSchemaviasuperRefinepackages/runtimegetMetaInstruction()into coordinator/delegate variantspackages/skill-manageraddDelegatecallback validates delegation rules (only dynamic path not covered by schema)@coordinator/namepatternperstack.toml@game-producer/*examples/Delegation rules
game-producer→@game-producer/designer)game-producer→other-coordinator)@game-producer/designer→@game-producer/programmer)@game-producer/designer→other-coordinator)game-producer→@other/expert)@game-producer/designer→game-producer)Test plan
pnpm typecheck— 23/23 packages passpnpm test— 93 test files, 1153 tests pass (includes new expert-type + schema delegation tests)pnpm format-and-lint— no new errorspnpm build— 23/23 packages buildpnpm run validate:changeset— passespnpm test:e2e— requires API keys (CI)🤖 Generated with Claude Code